/**
 * 分页data
 */
export type PageListData = {
  current: number;
  size: number;
  total: number;
};

export type AuditListParams = {
  pageSize: number;
  pageNo: number;
  code?: string;
  startTimes?: string;
  [props: string]: any;
};

export type AuditModelListParams = {
  modelName?: string;
};

export type auditCheckModelType = "dispose" | "submit";

export type mySubmitType = "all" | "pending" | "already";

export type AuditRecordItem = {
  action: string | null;
  approvalMode: string | null;
  comment: string[];
  finishTime: string;
  isFuture: boolean;
  name: string;
  nodeId: string;
  nodeType: string;
  result: string;
  signature: string | null;
  startTime: string;
  taskId: string;
  user: {
    avatar: string | null;
    id: string;
    name: string;
    sex: string | null;
    type: string | null;
  };
};

export type FileContextType = "image" | "video" | "unknown" | null;
export type StandardItem = {
  fieldName: string;
  fieldValue: any;
  valueComplex: boolean;
  fieldTypeName: string;
  fieldType: string | null;
  fileContextType: FileContextType;
};
export type FileItem = {
  fileName: string;
  fileUrl: string;
  fileId: string;
  fileType: string | null;
};
export type StandardForm = {
  imageList?: FileItem[];
  videoList?: FileItem[];
  fieldData: StandardItem[];
};

/**
 * 工作台消息&审批数量
 */
export type ProcessCount = {
  acceptAll: number; // 我审批-审批总数
  acceptUntreated: number; // 我审批-待审批数量
  acceptTreated: number; // 我审批-已审批数量
  sendAll: number; // 我发起-审批数量
  sendUntreated: number; // 我发起-待审批数量
  sendTreated: number; // 我发起-已审批数量
};
export type MessageCount = {
  acceptUnread: number; // 收到-未读消息数量
  acceptUntreated: number; // 收到-未处理消息数量
  acceptRead: number; // 收到-已读消息数量
  acceptTreated: number; // 收到-已处理消息数量
  acceptAndTreatedNum: number;
  sendUnread: number; //发起-（接收人）未读消息数量
  sendUntreated: number; // 发起-（接收人）未处理消息数量
  sendRead: number; // 发起-（接收人）已读消息数量
  sendTreated: number; // 发起-（接收人）已处理消息数量
  sendReadAndTreatedNum: number;
};
export type WorkbenchCount = {
  process: ProcessCount;
  msg: MessageCount;
};

/**
 * 工作台消息列表参数  params
 */
export type CategoryType = "processAccept" | "processSend" | "msgAccept" | "msgSend";
export type MessageType =
  | "all" //接收-所有
  | "untreated" // 接收-未处理 待审批
  | "treated" //接受-已处理 已审批
  | "unread" //接收-未阅读
  | "read" //发送-已阅读
  | "readAndTreated"; //已读/已处理
export type WorkbenchMsgListParams = {
  size: number;
  current: number;
  category: CategoryType; // 消息分类
  type: MessageType; // 消息类型
};

/**
 * 工作台消息列表数据 data
 */
export type WorkbenchMsgListItem = {
  title: string;
  user: string;
  createTime: string;
  status: string;
  autoTreated: string;
  dataId: string;
  nodeId: string;
  defId: string;
  formId: string;
} & WorkbenchMsgListParams;
export type MsgPageListData = {
  list: WorkbenchMsgListItem[];
} & PageListData;

/**
 * 消息详情 data
 */
export type AttachmentsListItem = {
  attacId?: string;
  msgId: string;
  url: string;
  fileName: string;
  [props: string]: any;
};
export type MsgDetail = {
  msgId: string;
  msgType: string;
  msgSource: string;
  sendBusiUserId: string;
  sendName: string;
  recipientCustomerId: string;
  recipientBusiUserId: string;
  recipientName: string;
  tenantId: string;
  noticeType: 1 | 2 | 3; //1--普通消息 2--查看可确认 3--查看可确认拒绝
  status: 1 | 2 | 3 | 4 | 5 | 6; // ，1--未查看，2--已查看待确认，3--已确认，4--已同意，5--已拒绝，6--已撤回
  autoTreated: string;
  autoConfirmTime: string;
  msgTitle: string;
  msgDescription: string;
  createTime: string;
  msgContent: string;
  attachmentsList: AttachmentsListItem[];
  isSender: boolean;
  isRecipient: boolean;
  opinionInfo: string;
};

/**
 * 消息确认参数 params
 */
export type MsgConfirmParams = {
  msgId: string;
  status: number;
  opinionInfo?: string;
  resourceUrls?: AttachmentsListItem[];
};

/**
 * 消息分页列表参数 params
 */
export type MsgPageListParams = {
  current?: number;
  size?: number;
  orderByColumn?: string;
  isAsc?: string;
  customerName: string;
  start: string;
  end: string;
  // 状态 1-未读 2-未处理 3-已确认 4 已同意 5-已拒绝 6-已撤回 已阅读-"2,3,4,5" 全部-不传status
  status: string;
  keyWords: string;
};

/**
 * 消息分页列表 各状态数量
 */
export type msgPageListCountData = {
  allNum: number;
  unreadNum: number;
  readNum: number;
  waitConfirmNum: number;
  confirmedNum: number;
  passNum: number;
  rejectNum: number;
  recallNum: number;
};
